// -------------------------------------------------
// BlinKit - BlinKit Library
// -------------------------------------------------
//   File Name: form_data_impl.cpp
// Description: FormDataImpl Class
//      Author: Ziming Li
//     Created: 2022-04-25
// -------------------------------------------------
// Copyright (C) 2022 MingYang Software Technology.
// -------------------------------------------------

#include "./form_data_impl.h"

#include "bk_ui.h"
#include "blinkit/blink/renderer/core/html/form_data.h"

using namespace blink;

static FormData* ToFormData(FormDataImpl *impl)
{
    return static_cast<FormData *>(impl);
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

extern "C" {

BKEXPORT bool_t BKAPI BkGetFormFieldCheckedState(BkFormData impl, const char *name)
{
    return ToFormData(impl)->GetFieldCheckedState(name);
}

BKEXPORT bool_t BKAPI BkGetFormFieldValue(BkFormData impl, const char *name, struct BkBuffer *dst)
{
    return ToFormData(impl)->GetFieldValue(name, dst);
}

} // extern "C"
